// const { defineConfig } = require('@vue/cli-service');

const { VantResolver } = require('unplugin-vue-components/resolvers');
const ComponentsPlugin = require('unplugin-vue-components/webpack');

const UnoCSS = require('@unocss/webpack').default;

module.exports = {
	publicPath: './',
	outputDir: 'build',
	productionSourceMap: false,
	devServer: {
		host: '0.0.0.0',
		port: 8080,
		proxy: {
			'/api': {
				target: 'http://192.168.0.123:8888',
				changeOrigin: true,
				ws: true,
				pathRewrite: {
					'^/api': '',
				},
			},
		},
		// proxy: {
		// 	'/api': {
		// 		target: 'https://szsb.hzxh.gov.cn:8080',
		// 		changeOrigin: true,
		// 		ws: true,
		// 		pathRewrite: {
		// 			'^/api': '',
		// 		},
		// 	},
		// },
	},
	configureWebpack: {
		plugins: [
			UnoCSS(),
			ComponentsPlugin({
				resolvers: [VantResolver()],
			}),
		],
		optimization: {
			realContentHash: true,
		},
	},
};
